#include "seqlist.h"

void testseqlist1()
{
	SL s1;
	seqlistinit(&s1);

	seqlistpushback(&s1, 1);
	seqlistpushback(&s1, 2);
	seqlistpushback(&s1, 3);
	seqlistpushback(&s1, 4);
	seqlistpushback(&s1, 5);
	seqlistprint(&s1);

	//seqlistdestory(&s1);
	seqlistpopback(&s1);
	seqlistpopback(&s1);
	seqlistpopback(&s1);
	seqlistpopback(&s1);
	seqlistpopback(&s1);
	seqlistpopback(&s1);
	seqlistprint(&s1);

	

	
}

void testseqlist2()
{
	SL s1;
	seqlistinit(&s1);

	seqlistpushback(&s1, 1);
	seqlistpushback(&s1, 2);
	seqlistpushback(&s1, 3);
	seqlistpushback(&s1, 4);
	seqlistpushback(&s1, 5);

	seqlistpushfront(&s1, 10);
	seqlistpushfront(&s1, 20);
	seqlistpushfront(&s1, 30);
	seqlistpushfront(&s1, 40);

	seqlistpopfront(&s1);
	seqlistpopfront(&s1);
	seqlistpopfront(&s1);

	seqlistprint(&s1);
}

void testseqlist3()
{
	SL s1;
	seqlistinit(&s1);

	seqlistpushback(&s1, 10);
	seqlistpushback(&s1, -20);
	seqlistpushback(&s1, 30);
	seqlistpushback(&s1, -40);
	seqlistpushback(&s1, 50);
	seqlistprint(&s1);
	printf("%d\n",seqlistfind(&s1, 20));


	seqlisttnsert(&s1, 3, -60);
	seqlistprint(&s1);

	seqlisterase(&s1, 4);
	seqlistprint(&s1);

	LpRn(&s1);
	seqlistprint(&s1);

	seqlistdestory(&s1);


}
int main()
{
	//testseqlist1();
	//testseqlist2();
	testseqlist3();
	return 0;
}